﻿#include "pch.h"
#include "spdlog/sinks/basic_file_sink.h"
#include "spdlog/sinks/stdout_color_sinks.h"

//extern WoLoggetPtr g_logger;

//void WEBOAT_API WoLoggerInfo(const char*msg) {
//	g_logger->info(msg);
//}

WoLoggetPtr WEBOAT_API WoLoggerCreateFileLogger(const char*loggerName,const char*fileName) {
	return spdlog::basic_logger_mt(loggerName, fileName);
}
WoLoggetPtr WEBOAT_API WoLoggerCreateConsoleLogger(const char* loggerName) {
	return spdlog::stdout_color_mt(loggerName);;
}

void WEBOAT_API WoLoggerSetLevel(WoLoggetPtr logPtr, WoLogLevel level) {
	logPtr->set_level((spdlog::level::level_enum)level);
}

void WEBOAT_API WoLoggerSetPattern(WoLoggetPtr logPtr, const char* pattern) {
	logPtr->set_pattern(pattern);
}

void WEBOAT_API WoLoggerSendTrace(WoLoggetPtr logPtr, const char* msg) {
	logPtr->trace(msg);
}
void WEBOAT_API WoLoggerSendDebug(WoLoggetPtr logPtr, const char* msg) {
	logPtr->debug(msg);
}
void WEBOAT_API WoLoggerSendInfo(WoLoggetPtr logPtr, const char* msg) {
	logPtr->info(msg);
}
void WEBOAT_API WoLoggerSendWarn(WoLoggetPtr logPtr, const char* msg) {
	logPtr->warn(msg);
}
void WEBOAT_API WoLoggerSendError(WoLoggetPtr logPtr, const char* msg) {
	logPtr->error(msg);
}
void WEBOAT_API WoLoggerSendCritical(WoLoggetPtr logPtr, const char* msg) {
	logPtr->critical(msg);
}

